home *** CD-ROM | disk | FTP | other *** search
- global gOBJECTS, sCURSORSPRITE, gTimerList, theButtonClasses, void
-
- on anyButton ObjRef
- if (ObjRef = #describe) or (ObjRef = void) then
- put "this button handler verifies on mouse up inside the hotRect -kam"
- put "It also allows use of a string or symbol "
- put "requires one parameter: 'ObjRef' in symbol format"
- put "use syntax: anyButton #thermdisplay"
- put "this handler not NOT conditional, which pushbutton is"
- exit
- end if
- set obj to getaProp(gOBJECTS, ObjRef)
- if not voidp(getaProp(getaProp(obj, #sound), #down)) then
- stopSound(getaProp(getaProp(obj, #sound), #down))
- playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast, #NOW)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
- updateStage()
- repeat while the stillDown
- if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
- else
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
- end if
- cursorandupdate()
- end repeat
- set myPoint to point(the mouseH, the mouseV)
- if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
- stopSound(getaProp(getaProp(obj, #sound), #UP))
- playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast, #NOW)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
- updateStage()
- if inside(myPoint, getAt(getaProp(obj, #HotRect), 1)) then
- do(string(getaProp(getaProp(obj, #action), #UP)))
- end if
- end
-
- on MultiState ObjRef
- set obj to getaProp(gOBJECTS, ObjRef)
- set nStates to count(getaProp(obj, #AllStates))
- set StateNum to getOne(getaProp(obj, #AllStates), getaProp(obj, #State))
- set StateNum to StateNum + 1
- if StateNum > nStates then
- set StateNum to 1
- end if
- setaProp(obj, #State, getAt(getaProp(obj, #AllStates), StateNum))
- set animlength to count(getaProp(getaProp(obj, #cast), getaProp(obj, #State)))
- repeat with aCast = animlength down to 1
- set the castNum of sprite getaProp(obj, #spriteNum) to getAt(getaProp(getaProp(obj, #cast), getaProp(obj, #State)), aCast)
- cursorandupdate()
- end repeat
- playSound(getaProp(getaProp(obj, #sound), getaProp(obj, #State)), #keyframeCast, #NOW)
- do(getaProp(getaProp(obj, #action), #UP))
- end
-
- on MultiStateCOND ObjRef
- set obj to getaProp(gOBJECTS, ObjRef)
- if getaProp(getaProp(gOBJECTS, getaProp(obj, #Parent)), #State) = getaProp(obj, #ParentState) then
- set nStates to count(getaProp(obj, #AllStates))
- set StateNum to getOne(getaProp(obj, #AllStates), getaProp(obj, #State))
- set StateNum to StateNum + 1
- if StateNum > nStates then
- set StateNum to 1
- end if
- setaProp(obj, #State, getAt(getaProp(obj, #AllStates), StateNum))
- playSound(getaProp(getaProp(obj, #sound), getaProp(obj, #State)), #keyframeCast)
- set animlength to count(getaProp(getaProp(obj, #cast), getaProp(obj, #State)))
- repeat with aCast = animlength down to 1
- set the castNum of sprite getaProp(obj, #spriteNum) to getAt(getaProp(getaProp(obj, #cast), getaProp(obj, #State)), aCast)
- cursorandupdate()
- end repeat
- do(getaProp(getaProp(obj, #action), #UP))
- end if
- end
-
- on ButtonDoDn ObjRef
- set obj to getaProp(gOBJECTS, ObjRef)
- if not voidp(getaProp(getaProp(obj, #sound), #down)) then
- stopSound(getaProp(getaProp(obj, #sound), #down))
- playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
- updateStage()
- repeat while the stillDown
- do(getaProp(getaProp(obj, #action), #WhileDown))
- cursorandupdate()
- end repeat
- if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
- stopSound(getaProp(getaProp(obj, #sound), #UP))
- playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
- do(getaProp(getaProp(obj, #action), #UP))
- updateStage()
- end
-
- on pushButton ObjRef
- set obj to getaProp(gOBJECTS, ObjRef)
- if getaProp(getaProp(gOBJECTS, getaProp(obj, #Parent)), #State) = getaProp(obj, #ParentState) then
- if not voidp(getaProp(getaProp(obj, #sound), #down)) then
- stopSound(getaProp(getaProp(obj, #sound), #down))
- playSound(getaProp(getaProp(obj, #sound), #down), #keyframeCast)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
- updateStage()
- repeat while the stillDown
- if inside(point(the mouseH, the mouseV), getAt(getaProp(obj, #HotRect), 1)) then
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #down)
- else
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
- end if
- cursorandupdate()
- end repeat
- set myPoint to point(the mouseH, the mouseV)
- if not voidp(getaProp(getaProp(obj, #sound), #UP)) then
- stopSound(getaProp(getaProp(obj, #sound), #UP))
- playSound(getaProp(getaProp(obj, #sound), #UP), #keyframeCast)
- end if
- set the castNum of sprite getaProp(obj, #spriteNum) to getaProp(getaProp(obj, #cast), #UP)
- updateStage()
- if inside(myPoint, getAt(getaProp(obj, #HotRect), 1)) then
- do(string(getaProp(getaProp(obj, #action), #UP)))
- end if
- end if
- end
-